Function Get-Union
{
    [CmdletBinding()]
    Param(
        [Parameter(Mandatory = $True)]
        [Object[]]
        $private:Array1,
        
        [Parameter(Mandatory = $True)]
        [Object[]]
        $private:Array2
    )
    
    Process
    {
        If ($Array1.Length -Le $Array2.Length)
        {
            $private:ToDict = $Array1
            $private:ToCompare = $Array2
        }
        Else
        {
            $private:ToDict = $Array2
            $private:ToCompare = $Array1
        }
        
        $private:Dict = @{}
        ForEach ($private:x in $ToDict)
        {
            $private:Dict[$x]++
        }
        
        ForEach ($private:x in $ToCompare)
        {
            $private:Dict[$x]++
        }
        
        Return $Dict.Keys
    }
}

Export-ModuleMember Get-Union
